using System.Collections;
using System.Text;
using Anvil.Core.Helpers;

namespace Anvil.Core.Helpers
{
	public class WebHelper : ViewHelper
	{

	    public override string Message(object message)
		{
			if (message==null) return null;
			StringBuilder sb = new StringBuilder("<p>");
			sb.Append(message.ToString());
			sb.Append("</p>");
			return sb.ToString();
		}

		public override string MessageList(IList messages)
		{
			StringBuilder sb = new StringBuilder("<ul>");
			foreach (object o in messages)
			{
				sb.Append("<li>");
                if (o != null) sb.Append(o.ToString());
				sb.Append("</li>");
			}
			sb.Append("</ul>");

			return sb.ToString();
		}
	}
}